"""获取gp列表
"""
import datetime
import datasource

def drop_last_year(df):
    today = datetime.datetime.now()
    last_year_today = today - datetime.timedelta(days=365)
    last_year_today_str = datetime.datetime.strftime(last_year_today, "%Y%m%d")
    return df[df["list_date"]<last_year_today_str]


def all_stock():
    all_stock = datasource.stocks()

    # 去None
    all_stock = all_stock.dropna()

    # 去掉最近一年的
    # drop_last_year(all_stock)

    return all_stock

if __name__ == "__main__":
    res = all_stock()
    print(res)
